package com.shd.edanpei.enums;


import com.shd.edanpei.R;

/**
 * Created by mc on 2018/6/4.
 */

public enum PaymentEnum {

    alipay("alipay", R.drawable.icon_alipay), points("points", 0), wechat("wechat", R.drawable.ic_pay_wechat);

    String type;
    int iconId;

    PaymentEnum(String type, int iconId) {
        this.type = type;
        this.iconId = iconId;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public static int getIcon(String type) {

        PaymentEnum[] valuse = values();
        for (PaymentEnum value : valuse) {
            if (value.type.equals(type)) {
                return value.iconId;
            }
        }
        return 0;
    }
}
